
import { CreateDate, Entity, Icon, PrimaryUuid, UpdateDate, Price, Title, Cover, Boolean, Desc, RichText, Digdit, GymCourseType, Tags, Code, Address, DisplayOrder, GymPlaceId, Jsonb, GymTeacherId, DateTime } from '@sker/core'
/**
 * why
 */
@Entity({
    name: 'gym_course',
})
export class GymCourse {
    static title: string = `课程`;
    static resource: string = `gym_course`;

    @PrimaryUuid({
        primaryKeyConstraintName: "PK_GYM_COURSE_ID"
    })
    id!: string;

    @GymCourseType({ comment: '分类' })
    type!: string;

    @Code({ label: '项目类型', comment: '项目类型，一对多、一对一等', default: '' })
    option_type: string;

    @Digdit({ label: '评星', default: 0 })
    star: number;

    @Digdit({ comment: '期数', default: 1 })
    index: number;

    @GymPlaceId({ label: '课程地址', nullable: true })
    place_id: string;

    @GymTeacherId({ label: '默认授课老师', nullable: true })
    teacher_id: string;

    @Jsonb({ comment: '开课时间', nullable: true })
    time_range: Date[];

    @Jsonb({ comment: '报名时间', nullable: true })
    join_time: Date[];

    @Jsonb({ label: '排课信息', nullable: true })
    week_times: { week: string[], times: any[] }[];

    @Jsonb({ label: '可用教练', nullable: true })
    can_use_teachers: any;

    @Code({ comment: '课时卡类型', nullable: true })
    card_type: string;

    @Digdit({ comment: '需要课时', nullable: true })
    card_time: number;

    @Digdit({ comment: '赠送自训次数', nullable: true })
    place_time: number;

    @Title({ comment: '英文名', default: '' })
    name!: string;

    @Title({ comment: '课程名称' })
    title!: string;

    @Desc({ comment: '课程简介', default: '' })
    desc!: string;

    @RichText({ comment: '课程描述', default: '' })
    content!: string;

    @Icon({ comment: '图标', default: '' })
    icon: string;

    @Cover({ comment: '缩略图', default: '' })
    cover!: string;

    @Boolean({ comment: '是否收费', default: false })
    is_free!: boolean;

    @Price({ comment: '单次价格', default: 0 })
    fee!: number;

    @Digdit({ comment: '最大容纳', default: 0 })
    max!: number;

    @Digdit({ comment: '最小开课人数', default: 0 })
    min!: number;

    @DisplayOrder({ comment: '顺序', default: 0 })
    displayorder: number;

    @Boolean({ default: true })
    status!: boolean;

    @Code({
        comment: '标签',
        default: ''
    })
    tag!: string;

    @Tags({ comment: '关键字', default: '' })
    keyword!: string;

    @Boolean({ comment: '推荐', default: false })
    is_feed!: boolean;

    @Digdit({ comment: '总课时', default: 0 })
    total: number;

    @Digdit({ comment: '剩余课时', default: 0 })
    remaining: number;

    @CreateDate({
        comment: '创建日期'
    })
    create_date!: Date;

    @UpdateDate({
        comment: '更新日期'
    })
    update_date!: Date;
}